package com.gongjian.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * 对应html静态页面
 * @author 董浩
 * @Description
 * @create 2019-03-22 10:09
 */
@Controller
public class Html {

    @RequestMapping("/html/{url}")
    public String login(@PathVariable String url, HttpSession session){
        if(url.equals("login")){
            session.removeAttribute("user");
        }
        if(session.getAttribute("user")==null){
         return "login";
        }
        return url;
    }
    @RequestMapping("/")
    public String login(){

        return "login";
    }
}
